Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsListData: [{
      id: 1,
      imgUrls: ["../image/food/food2.jpg"],
      goodprice: 88,
      goodTitle: "美食-披萨",
      goodDetails: ""
    }, {
      id: 2,
      imgUrls: ["../image/food/food1.jpg"],
      goodprice: 60,
      goodTitle: "美食-甜点",
      goodDetails: ""
    }, {
      id: 3,
      imgUrls: ["../image/food/food3.jpg"],
      goodprice: 128,
      goodTitle: "美食-帝王蟹",
      goodDetails: ""
    },
    {
      id: 4,
      imgUrls: ["../image/food/food4.jpg"],
      goodprice: 99,
      goodTitle: "美食-烤鸭",
      goodDetails: ""
    },
    {
      id: 5,
      imgUrls: ["../image/food/food5.jpg"],
      goodprice: 66,
      goodTitle: "美食-鸡翅",
      goodDetails: ""
    },
    
  ] //商品详情
  },

  // 搜索
  // 关键字
  keywords(e) {
    this.search(e.detail.value)
  },
  search(val) {
    // 搜索展示
  },
  // 跳转详情页
  navgoodsDetails(e) {
    // console.log(e.currentTarget.dataset.name.id)
    // 传入商品id
    wx.navigateTo({
      url: '../goodsDetails/goodsDetails?goodsId=' + e.currentTarget.dataset.name.id,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})